import request from '@/utils/request'

/**
 * @description: 工艺路线清单
 * @param {*} params
 * @return {*}
 */
export function routesetList(params) {
  return request({
    url: '/routeset/list',
    method: 'get',
    params
  })
}

/**
 * @description: 获取最后工艺路线设定的最后一项
 * @param {*} params
 * @return {*}
 */
export function getRouteSetLast(params) {
  return request({
    url: '/routeset/last',
    method: 'get',
    params
  })
}

/**
 * @description: 验证路线ID是否唯一
 * @param {*} params
 * @return {*}
 */
export function validateRouteID(params) {
  return request({
    url: '/routeset/routeid/validate',
    method: 'get',
    params
  })
}

/**
 * @description: 新增工艺路线
 * @param {*} data
 * @return {*}
 */
export function addRouteSet(data) {
  return request({
    url: '/routeset/add',
    method: 'post',
    data
  })
}

/**
 * @description: 获取工艺路线详情
 * @param {*} params
 * @return {*}
 */
export function getRouteDetail(params) {
  return request({
    url: '/routeset/detail',
    method: 'get',
    params
  })
}

/**
 * @description: 更新工艺路线
 * @param {*} data
 * @return {*}
 */
export function updateRouteSet(data) {
  return request({
    url: '/routeset/update',
    method: 'post',
    data
  })
}

/**
 * @description: 删除工艺路线
 * @param {*} data
 * @return {*}
 */
export function deleteRouteset(data) {
  return request({
    url: '/routeset/delete',
    method: 'post',
    data
  })
}
